var e = getApp();

Component({
    options: {
        addGlobalClass: !0
    },
    properties: {
        show: {
            value: !1,
            type: Boolean
        },
        details: {
            value: {},
            type: Object
        },
        reward_button: {
            value: {},
            type: Object
        }
    },
    data: {
        reward_type: "1",
        reward_number: ""
    },
    ready: function() {},
    methods: {
        closePopup: function() {
            this.triggerEvent("close");
        },
        bindChangeReward: function(e) {
            this.setData({
                reward_type: e.detail
            });
        },
        sendReward: function() {
            var t = this, r = this.data, a = r.reward_number, d = r.reward_type, s = r.details;
            if (!a || a <= 0) return e.tips("请输入打赏数量");
            var i = e.getNetAddresss("plugin.new-media-advertising.frontend.media-advertisingt.reward");
            e._getNetWork({
                url: i,
                data: {
                    advertisingt_id: s.id,
                    reward_number: a,
                    reward_type: d
                },
                success: function(r) {
                    var a = r.data;
                    e.tips(a.msg), 1 == a.result && (t.setData({
                        reward_type: "1",
                        reward_number: ""
                    }), t.triggerEvent("close"));
                }
            });
        }
    }
});